﻿CREATE TABLE [dbo].[Sponsor] (

	[Id] [dbo].[Id] NOT NULL IDENTITY(1000000000, 1), 
	
    [EntityId] [dbo].[Id] NOT NULL, 
	
    [SponsorTypeId] [dbo].[Id] NOT NULL,
	
    [NationalEmployerId] [dbo].[BusinessId] NOT NULL, 

    [CreateId] [dbo].[Name] NOT NULL DEFAULT SUSER_NAME () , 

    [CreateDateTime] [dbo].[CreateModifiedDateTime] NOT NULL DEFAULT GETDATE() , 

    [ModifiedId] [dbo].[Name] NOT NULL DEFAULT SUSER_NAME (),

    [ModifiedDateTime] [dbo].[CreateModifiedDateTime] NOT NULL DEFAULT GETDATE(), 

    CONSTRAINT [PK_Sponsor] PRIMARY KEY ([Id]), 

    CONSTRAINT [FK_Sponsor_SponsorTypeId] FOREIGN KEY (SponsorTypeId) REFERENCES SponsorType(Id), 

    CONSTRAINT [FK_Sponsor_EntityId] FOREIGN KEY (EntityId) REFERENCES Entity (Id)

)

GO

CREATE INDEX [IDX_Sponsor_NationalEmployerId] ON [dbo].Sponsor (NationalEmployerId)

GO